home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / mtools.lha / mtools-2.0.7 / msdos.h < prev    next >
C/C++ Source or Header  |  1992-09-10  |  2KB  |  62 lines

  1. /*
  2.  * msdos common header file
  3.  */
  4.  
  5. #define MSECTOR_SIZE    512        /* MSDOS sector size in bytes */
  6. #define MDIR_SIZE    32        /* MSDOS directory size in bytes */
  7. #define MAX_CLUSTER    8192        /* largest cluster size */
  8. #define MAX_PATH    128        /* largest MSDOS path length */
  9. #define MAX_DIR_SECS    64        /* largest directory (in sectors) */
  10.  
  11. #define NEW        1
  12. #define OLD        0
  13.  
  14. struct directory {
  15.     unsigned char name[8];        /* file name */
  16.     unsigned char ext[3];        /* file extension */
  17.     unsigned char attr;        /* attribute byte */
  18.     unsigned char reserved[10];    /* ?? */
  19.     unsigned char time[2];        /* time stamp */
  20.     unsigned char date[2];        /* date stamp */
  21.     unsigned char start[2];        /* starting cluster number */
  22.     unsigned char size[4];        /* size of the file */
  23. };
  24.  
  25. struct device {
  26.     char drive;            /* the drive letter */
  27.     char *name;            /* full path to device */
  28.     long offset;            /* skip this many bytes */
  29.     int fat_bits;            /* FAT encoding scheme */
  30.     int mode;            /* any special open() flags */
  31.     int (*gioctl) ();        /* gioctl() function if needed */
  32.     int tracks;            /* tracks */
  33.     int heads;            /* heads */
  34.     int sectors;            /* sectors */
  35. };
  36.  
  37. struct bootsector {
  38.     unsigned char jump[3];        /* Jump to boot code */
  39.     unsigned char banner[8];    /* OEM name & version */
  40.     unsigned char secsiz[2];    /* Bytes per sector hopefully 512 */
  41.     unsigned char clsiz;        /* Cluster size in sectors */
  42.     unsigned char nrsvsect[2];    /* Number of reserved (boot) sectors */
  43.     unsigned char nfat;        /* Number of FAT tables hopefully 2 */
  44.     unsigned char dirents[2];    /* Number of directory slots */
  45.     unsigned char psect[2];        /* Total sectors on disk */
  46.     unsigned char descr;        /* Media descriptor=first byte of FAT */
  47.     unsigned char fatlen[2];    /* Sectors in FAT */
  48.     unsigned char nsect[2];        /* Sectors/track */
  49.     unsigned char nheads[2];    /* Heads */
  50.     unsigned char nhs[4];        /* number of hidden sectors */
  51.     unsigned char bigsect[4];    /* big total sectors */
  52.     unsigned char junk[476];    /* who cares? */
  53. };
  54.  
  55. typedef void SIG_TYPE;
  56. /* typedef int SIG_TYPE; */
  57.  
  58. #ifdef BSD
  59. #define strchr index
  60. #define strrchr rindex
  61. #endif /* BSD */
  62.